<template>
  <div>
    <el-table :data="chargingItems" border>
      <el-table-column prop="payWay" label="支付方式" align="center" min-width="180">
        <template slot-scope="{ row }">
          <dict-tag
            :options="dict.type.sys_pay_way"
            :value="row.payWay"
          />
        </template>
      </el-table-column>

      <el-table-column label="收款账户" prop="paymentAccount" align="center" min-width="100" v-if="type == 1">
        <template slot-scope="{ row }">
          {{row.paymentAccount||'/'}}
        </template>
      </el-table-column>

      <el-table-column prop="payAmount" :label="type == 1?'收款金额':'退款金额'" align="center" min-width="100"/>

      <el-table-column prop="payTime" :label="type == 1?'收款时间':'退款时间'" align="center" min-width="200">
      <template slot-scope="{ row }">
          {{parseTime(row.payTime)}}
        </template>
      </el-table-column>


      <el-table-column prop="agent" label="经办人" align="center" min-width="100">
        <template slot-scope="{ row }">
          {{row.agent||'/'}}
        </template>
      </el-table-column>

      <el-table-column label="备注" prop="remark" align="center" min-width="180">
        <template slot-scope="{ row }">
          {{row.remark||'/'}}
        </template>
      </el-table-column>

      <el-table-column label="支付凭证" prop="url" align="center" min-width="100" v-if="type == 1">
        <template slot-scope="{ row }">
          <el-image v-if="row.url" class="preview" :src="getImgUrl(row.url)"
                    style="height: 100px; width: 100px;"
                    :preview-src-list="[getImgUrl(row.url)]" fit="contain"  > </el-image>
          <span v-else>/</span>
        </template>
      </el-table-column>

      <el-table-column prop="payTime" label="确认收款进度" align="center" min-width="200" v-if="type == 1">
        <template slot-scope="{ row }">
          {{row.isConfirm==1?"已确认":"待确认"}}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  dicts: ['sys_pay_way'],
  props: {
    chargingItems: {
      type: Array,
      default() {
        return []
      }
    },
    type: {//1收款 2退款
      type: Number,
      default() {
        return 1
      }
    },
  },
  data() {
    return {
    }
  },
  mounted() {
  },
  methods: {

  },
}
</script>
<style scoped>
.item-title {
  margin: 10px;
}
</style>
